package com.example.demo.Mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.example.demo.POJO.tEmployee1;

@Mapper
public interface Employee1Mapper {

	//查询所有
	@Select("select eid,ename,password,sex from employee1")
	public List<tEmployee1> findAll();
	
	//查询单个
	@Select("select eid,ename,password,sex from employee1 where eid=#{eid}")
	public tEmployee1 findById(Integer eid);
	
	//密码对比
	@Select("select eid,ename,password from employee1 where eid=#{eid}")
	public tEmployee1 equalPassword(Integer eid);
	
	//添加
	@Insert("insert into employee1(eid,ename,password) values (#{eid},#{ename},#{password})")
	public int addEmployee(tEmployee1 employee1);
	
	//删除
	@Delete("Delete from Employee1 where eid=#{eid}")
	public int deleteEmployee(Integer eid);
	
	//修改
	@Update("Update employee1 set ename=#{ename},password=#{password},sex=#{sex} where eid=#{eid}")
	public int updateEmployee(tEmployee1 employee1);
	
}
